In the following description, frames and packets will be considered synonymous and referred to as frames.
In general, communication apparatuses that deal with frames as transfer data (communication data) on a network are sometimes requested to independently collect statistical information. Examples of such statistical information includes the number of received frames, the number of received bytes, the number of dropped received frames, the number of transmitted frames, the number of transmitted bytes, and the number of dropped transmitted frames. Such statistical information is requested to be collected for each physical port or each logical flow.
FIG. 1 illustrates a network configuration, where there are a plurality of communication apparatuses 1 and a plurality of pieces of user terminal equipment 2. A communication apparatus 1 receives a frame transmitted from user terminal equipment 2, and transfers the frame to an appropriate destination on the basis of address information or the like stored in the frame. For example, when the user terminal equipment 2 transmits an Ethernet® frame or an Internet protocol (IP) frame, the communication apparatus 1 transfers the frame on the basis of a media access control (MAC) address stored in the Ethernet frame or an IP address stored in the IP frame.
FIG. 2 illustrates an internal block configuration of a communication apparatus 1. The communication apparatus 1 includes a plurality of line interface units 11, a switch unit 12, and an upper layer controller 13. The line interface units 11 have line ports, provide an interface function for connection to external devices, and perform processing for receiving and transmitting frames. The line interface units 11 are typically provided as removable cards, units, or modules. Hereinafter, such cards, units, and modules will be considered synonymous and referred to as cards.
The switch unit 12 transmits and receives data signals to and from the line interface units 11 within the apparatus, and provides a switching function for transfer of frames between the line interface units 11. The switch unit 12 is typically provided as a removable card. The upper layer controller 13 transmits and receives control signals to and from the line interface units 11 and the switch unit 12 within the apparatus, and controls the entire apparatus. The upper layer controller 13 controls, for example, various settings of each part of the apparatus, alarms, and statistical information. The upper layer controller 13 connects to maintenance management equipment 3, such as an external monitor, and other external devices to transmit and receive control and management data to and from them. The upper layer controller 13 is typically provided as a removable card. The line interface units 11, the switch unit 12, and the upper layer controller 13 may not be removable and may be integral with a motherboard (or a mother card) of the apparatus.
FIG. 3 illustrates a configuration for a receiving process of a line interface unit 11 in a related communication apparatus 1. Although the line interface unit 11 generally includes configurations for both receiving and transmitting processes, FIG. 3 illustrates only a configuration for a receiving process, for convenience of explanation. A configuration for a transmitting process will be described later on. Although an apparatus that transmits and receives Ethernet® frames is described as an example, the apparatus may be one that transmits and receives IP frames or asynchronous transfer mode (ATM) packets.
Referring to FIG. 3, the line interface unit 11 includes a receiving port controller 1111, a receiving port management table 1112, a received flow controller 1113, and a received flow management table 1114. The line interface unit 11 also includes a counter controller 1115 for receiving ports, a received frame counter 1116 equipped for each port, a counter controller 1117 for received flows, and a received frame counter 1118 equipped for each flow. The line interface unit 11 also includes a controller 1101 and a working memory 1102.
The receiving port controller 1111 controls received frames for each physical port. The receiving port controller 1111 typically has a termination function for each of a physical (PHY) layer and a MAC layer. When a frame is received from each port, the receiving port controller 1111 uses a receiving port number as an index (or key) to retrieve the corresponding information from the receiving port management table 1112. The receiving port controller 1111 then determines whether the receiving port is set as a valid port.
FIG. 4A illustrates a data structure of the receiving port management table 1112. As control information for each port, the receiving port management table 1112 stores “port valid/invalid” that indicates whether the port is valid. If the port is set as an invalid port, a received frame from this port is dropped.
Referring back to FIG. 3, when a frame is received on a valid port, the receiving port controller 1111 transmits to the counter controller 1115 a trigger signal and the receiving port number for incrementing the received frame counter 1116 corresponding to the port number by one. Also, the receiving port controller 1111 multiplexes received frames received from respective valid receiving ports and transmits the frames to the received flow controller 1113 downstream of the receiving port controller 1111. For example, when the port speed is 1 Gbps and the number of ports is 10, the receiving port controller 1111 multiplexes received frames and transmits them to the received flow controller 1113 at a speed of 10 Gbps. A notification of a trigger signal and a receiving port number to the counter controller 1115 is serially transferred in synchronization with frame multiplexing.
The counter controller 1115 controls access to the received frame counter 1116. Upon receipt of the trigger signal from the receiving port controller 1111, the counter controller 1115 reads from the received frame counter 1116 a value corresponding to the receiving port number that is received together with the trigger signal, adds one to the read value, and writes the resulting value to the received frame counter 1116. Thus, a counter segment corresponding to the receiving port number is incremented by one. The counter controller 1115 resolves a conflict between the receiving port controller 1111 and the controller 1101 over access to the received frame counter 1116. This can be realized by a timing process in which, when accesses from the receiving port controller 1111 and the controller 1101 are accepted at the same time, a response to the access from the controller 1101 is delayed and a higher priority is given to processing performed by the receiving port controller 1111.
The received flow controller 1113 performs flow-by-flow control for each virtual local area network (VLAN) ID or VID of a received frame.
FIG. 5 illustrates an Ethernet frame format with a VLAN tag. As illustrated, a VID (or VLAN ID) is stored in the VLAN tag.
Referring back to FIG. 3, when each frame is received, the received flow controller 1113 uses a VID as an index (or key) to retrieve the corresponding information from the received flow management table 1114. The received flow controller 1113 then determines whether the received VID is set as a valid VID.
FIG. 4B illustrates a data structure of the received flow management table 1114. As control information for each VID, the received flow management table 1114 stores “VID valid/invalid” that indicates whether the VID is valid. A received frame having an invalid VID is dropped.
Referring back to FIG. 3, when a frame having a valid VID is received, the received flow controller 1113 transmits to the counter controller 1117 a trigger signal and the received VID for incrementing the received frame counter 1118 by one. Also, the received flow controller 1113 transmits frames each having a valid VID to the switch unit 12 downstream of the received flow controller 1113.
The counter controller 1117 controls access to the received frame counter 1118. Upon receipt of the trigger signal from the received flow controller 1113, the counter controller 1117 reads from the received frame counter 1118 a value corresponding to the VID that is received together with the trigger signal, adds one to the read value, and writes the resulting value to the received frame counter 1118. Thus, a counter segment corresponding to the received VID is incremented by one. The counter controller 1117 resolves a conflict between the received flow controller 1113 and the controller 1101 over access to the received frame counter 1118. This can be realized by a timing process in which, when accesses from the received flow controller 1113 and the controller 1101 are accepted at the same time, a response to the access from the controller 1101 is delayed and a higher priority is given to processing performed by the received flow controller 1113.
The controller 1101 is a component which includes a central processing unit (CPU). Through a control bus within the line interface unit 11, the controller 1101 performs setting and control for each part of the line interface unit 11, and collects statistical information from each counter. Also, through a control bus within the apparatus, the controller 1101 transmits and receives control data and management data to and from the upper layer controller 13.
The working memory 1102 is a memory that the controller 1101 uses to perform processing by software (or program).
FIG. 6 illustrates a configuration for a transmitting process of a line interface unit 11 in the related communication apparatus 1.
Referring to FIG. 6, the line interface unit 11 includes a transmitting port controller 1121, a transmitting port management table 1122, a transmitted flow controller 1123, and a transmitted flow management table 1124. The line interface unit 11 also includes a counter controller 1125 for transmitting ports, a transmitted frame counter 1126 equipped for each port, a counter controller 1127 for transmitted flows, and a transmitted frame counter 1128 equipped for each flow. The controller 1101 and the working memory 1102 are common to those for the receiving process described above.
FIG. 7 illustrates data structures of the transmitting port management table 1122 and the transmitted flow management table 1124. Like the receiving port management table 1112 illustrated in FIG. 4A, as control information for each port, the transmitting port management table 1122 stores “port valid/invalid” that indicates whether the port is valid. The transmitted flow management table 1124 stores “destination port number” in addition to “VID valid/invalid” stored in the received flow management table 1114 illustrated in FIG. 4B.
Referring to FIG. 6, in a transmitting control operation of the line interface unit 11, the transmitted flow controller 1123 receives a frame received through the switch unit 12, determines a VID value in the received frame, and uses the VID value as an index (or key) to search the transmitted flow management table 1124.
If the VID is invalid, the transmitted flow controller 1123 drops the received frame. If the VID is valid, the transmitted flow controller 1123 transmits the received frame, together with a destination port number retrieved from the transmitted flow management table 1124, to the transmitting port controller 1121 downstream of the transmitted flow controller 1123. Also, the transmitted flow controller 1123 transmits a trigger signal and the VID value to the counter controller 1127. Upon receipt of the trigger signal, the counter controller 1127 increments a counter value of the transmitted frame counter 1128 corresponding to the VID by one.
Upon receipt of the frame and the destination port number, the transmitting port controller 1121 uses the received destination port number as an index (or key) to search the transmitting port management table 1122.
If the port found is invalid, the transmitting port controller 1121 drops the received frame. If the port found is valid, the transmitting port controller 1121 transmits the frame from the port to the outside. At the same time, the transmitting port controller 1121 transmits a trigger signal and the destination port number to the counter controller 1125. Upon receipt of the trigger signal, the counter controller 1125 increments a counter value of the transmitted frame counter 1126 corresponding to the destination port number by one.
Examples of known techniques are disclosed in Japanese Laid-open Patent Publication No. 2005-51736 and Japanese Laid-open Patent Publication No. 2001-344190.